package com.qingke.beSuper2.command;

import java.util.HashMap;
import java.util.Map;

import com.qingke.beSuper2.command.impl.ExitCommand;
import com.qingke.beSuper2.command.impl.HelpCommand;
import com.qingke.beSuper2.command.impl.LoginCommand;
import com.qingke.beSuper2.command.impl.SignUpCommand;

public class SystemCommandFactory extends CommandFactory{

	private static Map<CommandCode, Command> commandMap = new HashMap<>();
	
	static {
		commandMap.put(CommandCode.EXIT, new ExitCommand());
		commandMap.put(CommandCode.HELP, new HelpCommand());
		commandMap.put(CommandCode.LOGIN, new LoginCommand());
		commandMap.put(CommandCode.SIGNUP, new SignUpCommand());
	}
	
	public Command buildCommand(CommandCode cmd) {
		Command command = commandMap.get(cmd);
		return command;
	}
}
